<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('Admin/AdminUser/index')}">设置入口</a></li>
    </ul> 
    <form method="post" class="form-horizontal js-ajax-form" id="form.js-ajax-forms"
          action="{:U('Admin/AdminUser/adminUserPost')}">
          
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*姓名</label>
            <div class="span3" ><input type="text" style="width: 556px;" name="real_name"  ></div>
        </div>
        
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*账号</label>
            <div class="span3" ><input type="text" style="width: 556px;" name="username" ></div>
        </div>
        
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">*密码</label>
            <div class="span3" ><input type="password" style="width: 556px;" name="admin_pwd"  ></div>
        </div>
        
        
        
		<input type="hidden" name="news_id" id="news_id" value="{$news_id}">
        <div class="form-actions" style="padding-left:260px;">
            <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
            &nbsp;&nbsp;<a class="btn" href="{:U('Admin/AdminUser/index')}">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript"
        src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script>
//ajax 提交表单
$(document).ready(function(){
    $("#ajaxform").click(function(){    // 提交按钮触发事件
    	//获取新闻业务和其他业务的选中值
    	var boxes = $("[name='column_checbox[]']");
    	var boxes1 = $("[name='sys_menu_checbox[]']");
        var column_checbox = []
        var sys_menu_checbox = []
        for(i=0;i<boxes.length;i++){
            if(boxes[i].checked == true){
            	column_checbox.push(boxes[i].value);
            }
        }
        for(i=0;i<boxes1.length;i++){
            if(boxes1[i].checked == true){
            	sys_menu_checbox.push(boxes1[i].value);
            }
        }

        var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址
        var admin_id = $("#admin_id").val();
        var area_hidden_ids = $("#area_hidden_ids").val();

        $.post(tourl,{
        	column_checbox:column_checbox,
        	sys_menu_checbox:sys_menu_checbox,
        	area_hidden_ids:area_hidden_ids,
        	admin_id:admin_id},function(result){
        	if(result == '1'){
        		var msg = '编辑成功';
        	}else{
        		var msg = '编辑失败';
        	}
        	
    		parent.layer.msg(msg,{time:2000},1,function(a){
        		
    		});
    		setTimeout(function(){
    			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
    			parent.layer.close(index);
    		}, 1000);
          });
    });
    $("#ajaxback").click(function(){
    	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
		parent.layer.close(index);
    });
});
</script>
</body>
</html>